/*
package com.yinNuo.collectWool.Task;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yinNuo.collectWool.collectWoolHttp.TencentZiXuanGuHttp;
import com.yinNuo.collectWool.core.constant.Costant;
import com.yinNuo.collectWool.mobileApi.entity.UserDoTask;
import com.yinNuo.collectWool.mobileApi.service.UserDoTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

*/
/**
 * @author: yinNuo
 * create at: 2021/12/13 下午8:51
 * @description: 腾讯自选股定时任务
 *//*

@Component
@EnableScheduling
@Slf4j
public class TencentZiXuanGuTask {
    @Autowired
    TencentZiXuanGuHttp tencentZiXuanGuHttp;

    @Resource
    private UserDoTaskService userDoTaskService;

    //获取票据
    public String getTicket(UserDoTask userDoTask){
        String getTicket = "?channel=1&action=taskticket&actid=1033&qluin=0C7DD40EF66F453333D89343D0DA8029&qlskey=v0ba829802561b73d8525898a5fd0a8c";
//       return tencentZiXuanGuHttp.getPiaoJu(userDoTask.getToken());
        String piaoJu = tencentZiXuanGuHttp.getPiaoJu(getTicket);
        log.info("获得票据结果:{}", piaoJu);
       return piaoJu;
    }


    //查看选股卡页
    @Scheduled(cron = "0 0 0 * * ? ")
    public void chaKaXuanGuKa(){
        List<UserDoTask> list = userDoTaskService.list(new QueryWrapper<UserDoTask>().eq("wool_task_id", Costant.JIUZHANG_ID));
        for (UserDoTask userDoTask : list) {
            if (userDoTask.getWoolTaskDetailId() == 1) {
                String piaoJu = getTicket(userDoTask);
                String param = "?channel=1&action=taskdone&task_ticket="+piaoJu+"&actid=1033&tid=14&id=7&_appName=ios&_dev=iPhone10,2&_devId=e89d4a891da4ba4bd967479e250e01219047f2ed&_appver=9.6.0&_osVer=13.6&qluin=0C7DD40EF66F453333D89343D0DA8029&qlskey=v0ba829802561b73d8525898a5fd0a8c&login_type=qq&openid=0C7DD40EF66F453333D89343D0DA8029&access_token=06A5D5306D76E290DAA9CE2E724966DB&fskey=v0ba829802561b73d8525898a5fd0a8c&guid=52D56D83-D1BF-4EAC-BF3D-04A4A194F4F8&_appName=ios&_dev=iPhone10,2&_devId=e89d4a891da4ba4bd967479e250e01219047f2ed&_appver=9.6.0&_ifChId=&_isChId=1&_osVer=13.6&openid=0C7DD40EF66F453333D89343D0DA8029&fskey=v0ba829802561b73d8525898a5fd0a8c&appid=101481127&access_token=06A5D5306D76E290DAA9CE2E724966DB&buildType=store&check=10&_idfa=&lang=zh_CN";
                String s = tencentZiXuanGuHttp.chaKaXuanGuKa(param);
                log.info("查看选股卡页结果:{}", s);
            }
        }
    }

    //查看今日大盘行情
    @Scheduled(cron = "0 0 0 * * ? ")
    public void chaKaDaPanHangQing(){
        List<UserDoTask> list = userDoTaskService.list(new QueryWrapper<UserDoTask>().eq("wool_task_id", Costant.JIUZHANG_ID));
        for (UserDoTask userDoTask : list) {
            if (userDoTask.getWoolTaskDetailId() == 1) {
                String piaoJu = getTicket(userDoTask);
                String param = "?id=6&tid=11&task_ticket="+piaoJu+"&actid=1033&channel=1&action=taskdone&_rndtime=1639403476&_appName=ios&_dev=iPhone10,2&_devId=e89d4a891da4ba4bd967479e250e01219047f2ed&_appver=9.6.0&_ifChId=&_isChId=1&_osVer=13.6&openid=0C7DD40EF66F453333D89343D0DA8029&fskey=v0ba829802561b73d8525898a5fd0a8c&appid=101481127&access_token=06A5D5306D76E290DAA9CE2E724966DB&buildType=store&check=10&_idfa=&lang=zh_CN";
                String s = tencentZiXuanGuHttp.chaKaDaPanHangQing(param);
                log.info("查看今日大盘行情结果:{}", s);
            }
        }
    }

    //阅读一篇咨询
    @Scheduled(cron = "0 0 0 * * ? ")
    public void yueDuZiXun(){
        List<UserDoTask> list = userDoTaskService.list(new QueryWrapper<UserDoTask>().eq("wool_task_id", Costant.JIUZHANG_ID));
        for (UserDoTask userDoTask : list) {
            if (userDoTask.getWoolTaskDetailId() == 1) {
                String piaoJu = getTicket(userDoTask);
                String param = "?action=taskdone&channel=1&actid=1033&tid=5&id=1&task_ticket="+piaoJu+"&_appName=ios&_dev=iPhone10,2&_devId=e89d4a891da4ba4bd967479e250e01219047f2ed&_appver=9.6.0&_ifChId=&_isChId=1&_osVer=13.6&openid=0C7DD40EF66F453333D89343D0DA8029&fskey=v0ba829802561b73d8525898a5fd0a8c&appid=101481127&access_token=06A5D5306D76E290DAA9CE2E724966DB&buildType=store&check=10&_idfa=&lang=zh_CN";
                String s = tencentZiXuanGuHttp.yueDuZiXun(param);
                log.info("阅读一篇咨询结果:{}", s);
            }
        }
    }

    //通过推荐首页加自持
    @Scheduled(cron = "0 0 0 * * ? ")
    public void tuiJianShouYeJiaZiChi(){
        List<UserDoTask> list = userDoTaskService.list(new QueryWrapper<UserDoTask>().eq("wool_task_id", Costant.JIUZHANG_ID));
        for (UserDoTask userDoTask : list) {
            if (userDoTask.getWoolTaskDetailId() == 1) {
                String piaoJu = getTicket(userDoTask);
                String param = "?id=4&tid=46&task_ticket="+piaoJu+"&actid=1033&channel=1&action=taskdone&_rndtime=1639405323&_appName=ios&_dev=iPhone10,2&_devId=e89d4a891da4ba4bd967479e250e01219047f2ed&_appver=9.6.0&_ifChId=&_isChId=1&_osVer=13.6&openid=0C7DD40EF66F453333D89343D0DA8029&fskey=v0ba829802561b73d8525898a5fd0a8c&appid=101481127&access_token=06A5D5306D76E290DAA9CE2E724966DB&buildType=store&check=10&_idfa=&lang=zh_CN";
                String s = tencentZiXuanGuHttp.tuiJianShouYeJiaZiChi(param);
                log.info("通过推荐首页加自持结果:{}", s);
            }
        }
    }

    //完成猜涨跌游戏 // TODO: 2021/12/13  这个不需要票据
    @Scheduled(cron = "0 0 0 * * ? ")
    public void caiZhangDieYouXi(){
        List<UserDoTask> list = userDoTaskService.list(new QueryWrapper<UserDoTask>().eq("wool_task_id", Costant.JIUZHANG_ID));
        for (UserDoTask userDoTask : list) {
            if (userDoTask.getWoolTaskDetailId() == 1) {
                String param = "?actid=1033&id=5&tid=47&action=taskstatus&_=1639405541192&openid=0C7DD40EF66F453333D89343D0DA8029&fskey=v0ba829802561b73d8525898a5fd0a8c&channel=1&access_token=06A5D5306D76E290DAA9CE2E724966DB&_appName=ios&_appver=9.6.0&_osVer=13.6&_devId=e89d4a891da4ba4bd967479e250e01219047f2ed";
                String s = tencentZiXuanGuHttp.caiZhangDieYouXi(param);
                log.info("完成猜涨跌游戏结果:{}", s);
            }
        }
    }



    //每日任务

    //查看热搜，添加自选
    @Scheduled(cron = "0 0/1 * * * ? ")
    public void resouZiXuan(){
        List<UserDoTask> list = userDoTaskService.list(new QueryWrapper<UserDoTask>().eq("wool_task_id", Costant.JIUZHANG_ID));
        for (UserDoTask userDoTask : list) {
            if (userDoTask.getWoolTaskDetailId() == 1) {
                String piaoJu = getTicket(userDoTask);
                String param = "?id=3&tid=49&task_ticket="+piaoJu+"&actid=1111&channel=1&action=taskdone&_rndtime=1639408257&_appName=ios&_dev=iPhone10,2&_devId=e89d4a891da4ba4bd967479e250e01219047f2ed&_appver=9.6.0&_ifChId=&_isChId=1&_osVer=13.6&openid=0C7DD40EF66F453333D89343D0DA8029&fskey=v0ba829802561b73d8525898a5fd0a8c&appid=101481127&access_token=06A5D5306D76E290DAA9CE2E724966DB&buildType=store&check=10&_idfa=&lang=zh_CN";
                String s = tencentZiXuanGuHttp.caiZhangDieYouXi(param);
                log.info("查看热搜，添加自选结果:{}", s);
            }
        }
    }














}
*/
